package com.babysun.sysbase;

import java.io.Serializable;
import java.util.List;

import org.springframework.stereotype.Component;

import com.babysun.commons.dbutil.DB;
import com.babysun.commons.util.RandomUtil;
import com.babysun.consts.TABLE;
import com.babysun.web.pojo.OrgVo;


@Component
public class OrgService implements IOrg {

	public void saveOrg(OrgVo rv) {
		String sql = "INSERT INTO "+TABLE.BABYSUN_ORG+"(OrgCode,OrgName,OrgLegalPerson,EstablishCountry,EstablishTime,OrgAddr) VALUES(?,?,?,?,?,?)" ;
		
		Object[] val = new Object[]{RandomUtil.getDateNum(11),rv.getOrgName(),rv.getOrgLegalPerson(),rv.getEstablishCountry(),rv.getOrgAddr()};
		
		try {
			DB.insert(sql, val) ;
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public void deleteOrg(Serializable id) {
		
		
	}

	public void updateOrg(OrgVo rv) {
		
		
	}

	public List<OrgVo> getScrollRecord(int startPage, int endPage,
			Object... param) {
		
		return null;
	}

}
